package com.bocloud.cmp.driver.utils;

import java.io.IOException;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PropertiesLoaderUtils;

public class Configure {
    private static Logger logger = LoggerFactory.getLogger(Configure.class);
    private Resource resource;
    private Properties props = null;

    public Configure(String pathResource) {
        super();
        this.resource = new ClassPathResource(pathResource);/// "config/application.properties"
        try {
            props = PropertiesLoaderUtils.loadProperties(resource);
        } catch (IOException e) {
            logger.error("Get properties exception" + e);
        }
    }

    public String getkey(String key) {
        return props.getProperty(key);
    }

}
